Conversation
…tibility dbt-fusion's Rust YAML parser does not resolve YAML merge keys (<<:), causing 'dbt1005: missing type field in resolved profile output' errors when it tries to parse the 'elementary' profile targets that inherited fields via merge keys from the 'elementary_tests' anchors. This commit: - Replaces the Jinja2 for-loop that generated merge-key-based targets in the 'elementary' profile with explicit full target definitions - Removes the now-unused YAML anchors (&name) from elementary_tests - Preserves identical rendered output (same fields, same values) Fixes fusion CI jobs for snowflake, bigquery, and databricks_catalog. Co-Authored-By: Noy Arie <noyarie1992@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
👋 @devin-ai-integration[bot] |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRefactored the dbt profile Jinja template to replace YAML anchors and a targets loop with Jinja macros that emit explicit per-adapter target blocks; schema/dataset fields were parameterized and the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
integration_tests/profiles/profiles.yml.j2 (1)
169-318: Consider reducing duplication to prevent target drift over time.Now that merge keys are removed, maintaining two full target maps increases mismatch risk when a field is added/changed in one profile but not the other. A shared Jinja structure (rendered twice with different schema suffix) would keep fusion compatibility and cut maintenance cost.
♻️ Non-blocking refactor sketch
+{% macro render_outputs(schema_suffix='') -%} + postgres: + type: postgres + ... + schema: {{ schema_name }}{{ schema_suffix }} + ... + bigquery: + type: bigquery + project: {{ bigquery_project | toyaml }} + dataset: {{ schema_name }}{{ schema_suffix }} + ... +{%- endmacro %} + elementary_tests: target: postgres outputs: - ... explicit blocks ... +{{ render_outputs('') | indent(4, true) }} elementary: target: postgres outputs: - ... explicit blocks ... +{{ render_outputs('_elementary') | indent(4, true) }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@integration_tests/profiles/profiles.yml.j2` around lines 169 - 318, The profiles.yml.j2 duplicates full target maps for two schema variants which risks drift; refactor by extracting the repeated target map into a single Jinja macro or reusable block (e.g., define a macro render_target(name, schema_suffix) or a variable targets_map) and then invoke it twice with the different schema suffixes (referencing the existing target identifiers like postgres, clickhouse, trino, dremio, spark, duckdb, sqlserver, vertica, snowflake, bigquery, redshift, databricks_catalog, fabric, athena) so the same source of truth produces both "{{ schema_name }}_elementary" variants; ensure all per-target keys (host/port/user/password/schema/threads/etc.) are defined only inside the macro and replace the duplicated blocks with calls to that macro passing the appropriate suffixes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@integration_tests/profiles/profiles.yml.j2`:
- Around line 169-318: The profiles.yml.j2 duplicates full target maps for two
schema variants which risks drift; refactor by extracting the repeated target
map into a single Jinja macro or reusable block (e.g., define a macro
render_target(name, schema_suffix) or a variable targets_map) and then invoke it
twice with the different schema suffixes (referencing the existing target
identifiers like postgres, clickhouse, trino, dremio, spark, duckdb, sqlserver,
vertica, snowflake, bigquery, redshift, databricks_catalog, fabric, athena) so
the same source of truth produces both "{{ schema_name }}_elementary" variants;
ensure all per-target keys (host/port/user/password/schema/threads/etc.) are
defined only inside the macro and replace the duplicated blocks with calls to
that macro passing the appropriate suffixes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 658d031d-80ff-44f2-bbaf-76d8b1875830
📒 Files selected for processing (1)
integration_tests/profiles/profiles.yml.j2
|
Good suggestion — I considered the Jinja macro approach initially. I went with explicit definitions for this PR to keep the fix simple and reviewable, but a follow-up refactor using a shared macro (as you sketched) would be a nice improvement to prevent drift. Happy to do that as a separate PR if the team prefers. |
Summary
Fixes the
dbt1005: missing 'type' field in resolved profile outputerror that causes all three dbt-fusion CI jobs (snowflake, bigquery, databricks_catalog) to fail at the "Check DWH connection" step.Root cause: The
elementaryprofile inprofiles.yml.j2used YAML merge keys (<<: *anchor) to inherit target configs fromelementary_tests. dbt-fusion's Rust-based YAML parser does not resolve YAML merge keys, so theelementaryprofile's targets were missing thetypefield (and all other inherited fields), causing thedbt1005error.Fix: Replace the Jinja2 for-loop that generated merge-key-based targets with explicit full target definitions. Also removes the now-unused YAML anchors (
&name) fromelementary_tests. The rendered output is semantically identical — same fields, same values, same behavior.Ref: Failing workflow run
Review & Testing Checklist for Human
elementaryprofile targets in the renderedprofiles.ymlmatch theelementary_teststargets (same fields, onlyschema/datasetdiffers with_elementarysuffix)elementary_testsprofile structure is unchanged)Notes
<<:merge key syntax.dremiotarget'sroot_pathin theelementaryprofile still points to{{ schema_name }}(not{{ schema_name }}_elementary), matching the previous merge-key behavior where onlyschemawas overridden.Link to Devin session: https://app.devin.ai/sessions/076900e0d9464d56b1fa163b657cd7d1
Requested by: @NoyaArie
Summary by CodeRabbit